<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    var a = { a: 1 };
    var b = { b: 2 };
    var c = { c: 3 };

    // 将三个对象的属性合并到一起  变成一个对象
    // var obj = {}
    // for (var key in a) {
    //     obj[key] = a[key]
    // }
    // for (var key in b) {
    //     obj[key] = b[key]
    // }
    // for (var key in c) {
    //     obj[key] = c[key]
    // }

    //  Object.assign(target, argObj, argObj, argObj);
    // var obj = {};
    // var res = Object.assign(obj, a, b, c);
    // console.log(res);
    // console.log(res === obj);

    // ...
    var obj = {
        ...a,
        ...b,
        ...c
    }




</script>

</html>